package rpcsimpledemo.Test;

import rpcsimpledemo.consumer.RpcConsumer;
import rpcsimpledemo.server.HelloService;

/**
 * description
 *
 * @author Llx
 * @version v1.0.0
 * @since 2018/9/27
 */
public class ClientBootstrap {

    public static final String providerName = "HelloService#hello#";

    public static void main(String[] args) throws InterruptedException {

        RpcConsumer consumer = new RpcConsumer();
        // 创建一个代理对象
        HelloService service = (HelloService) consumer
                .createProxy(HelloService.class, providerName);
        int i= 0;
        for (; ; ) {

            Thread.sleep(1000);
            System.out.println(service.hello("are you ok ,"+i+"?"));
            i++;
        }
    }

}
